1. Field of the Invention
The present invention relates to an apparatus and a method for decoding compressed and coded data. More particularly, the present invention relates to an apparatus and a method for decoding a bit string which is obtained by compressing and coding a moving-picture video signal by a variable-length code.
2. Description of the Related Art
In recent years, as image data compression techniques for video images, an interframe motion compensation coding, a variable-length coding, and a composite coding in which these coding techniques are combined have been developed. When data has been coded in accordance with such a coding technique, and transmitted and/or recorded, a variable-length-code decoder which can perform its processing at a high bit rate and can cope with errors is required for decoding and reproducing the data.
FIG. 7 schematically shows an exemplary conventional variable-length code decoder. As shown in FIG. 7, a variable-length-code decoder 700 includes an input terminal 71, a codelength selector/shifter 72, a first code table 73, a second code table 74, and an output circuit 75. The codelength selector/shifter 72 contains a format of the input bit string (recorded in the hardware).
The operation of the variable-length-code decoder 700 having the above-described construction will be described in the case where two code tables of variable-length codes are used. An input bit string is input from an input terminal 71. The codelength selector/shifter 72 selects a corresponding variable-length code table, in accordance with the recorded format. For example, first, when a codeword of a first variable-length code is input, the codelength selector/shifter 72 selects the first code table 73, so as to decode the codeword. The decoded result (i.e., the decoded-word) is output to the output circuit 75.
Next, the codelength selector/shifter 72 selects the second code table 74 in accordance with the recorded format, and decodes a variable-length codeword belonging to the second variable-length code. Then, the decoded result is output to the output circuit 75. If the decoded result is zero, the zero data is directly output.
By repeating the above-described operation, the decoding of variable-length code is performed by the codelength selector/shifter 72 in accordance with the recorded format. Such a codelength selector/shifter 72 is described, for example, in "A parallel Variable-Length-Code Decoder for Advanced Television Applications", Third International Workshop on HDTV, by Ming-Ting Sun and Shaw-Min Lei.
In the above-described conventional variable-length-code decoder, if the format of the input bit string is changed, it is necessary to change the hardware of the circuit so as to accommodate the change of the format. If the decoded data is a series of zeros, it takes a lot of time to output a number of zero data, similar to the case where data having a value other than zero is to be output.